# 导包
import unittest
from HTMLTestRunner2 import HTMLTestRunner
import time

# 创建测试套件
import app

suite = unittest.defaultTestLoader.discover("./script", "test*")

# 执行测试套件
# unittest.TextTestRunner().run(suite)

# 定义测试报告生成路径
report_path = app.BATH_DIR + "/report/{}_JR_reporter.html".format(time.strftime("%Y%m%d-%H%M%S"))

# 生成测试报告
with open(report_path, mode="wb") as f:
    runner = HTMLTestRunner(f,
                            verbosity=2,
                            title="黑马软测21期-金融接口测试报告",
                            description="2020-05-29中粮公园"
                            )
    runner.run(suite)

